<?php echo $this->Html->script(array('actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array('admin.index','form','actions'),null,array('inline'=>false));?>

<div id="content_repeat">
	<div class="grid_3">
	    
			<?php if($user_typ == 'users'){?>
				
				<div id="tabs-users">
					<h2><?php __('Users');?></h2>
					<table cellpadding="0" cellspacing="0" class="index">
						<tr>
							<th><?php echo __('No',true);?></th>
							<th><?php echo __('Email',true);?></th>
							<th><?php echo __('Status',true);?></th>							
							<th><?php echo __('First Name',true);?></th>
							<th><?php echo __('Last Name',true);?></th>
							<th class="actions t-right"><?php echo $this->Html->link(__('Nowy Użytkownik', true), array('action' => 'add_user'),array('class'=>'add')); ?></th>
						</tr>
						<?php
						$i = 0;
						if(isset($users) && !empty($users)){
						foreach ($users as $user){
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>
						<tr<?php echo $class;?>>
							<td><?php echo $user['User']['id']; ?>&nbsp;</td>
							<td><?php echo $user['User']['email']; ?>&nbsp;</td>
							<td><?php echo $this->Html->link((($user['User']['status']) ? __('aktywny',true) : __('nie aktywny',true)),array('controller'=>'users','action' => 'status', $user['User']['id'])) ?>&nbsp;</td>					
							<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
							<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
							<td class="actions">
								<?php echo $this->Html->link('', array('controller'=>'users','action' => 'edit', $user['User']['id']),array('title'=>__('edytuj', true),'class'=>'edit')); ?>
								<?php echo $this->Html->link('', array('action' => 'delete', $user['User']['id']),array('title'=>__('usuń', true),'class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
							</td>
						</tr>
						<?php }}; ?>
					</table>
				</div>
				<?php }?>
				
				<?php if($user_typ == 'emplo'){?>
								
					<div id="tabs-users">
						<h2><?php __('Pracownicy');?></h2>
						<table cellpadding="0" cellspacing="0" class="index">
							<tr>
								<th><?php echo __('No',true);?></th>
								<th><?php echo __('Email',true);?></th>
								<th><?php echo __('Status',true);?></th>							
								<th><?php echo __('First Name',true);?></th>
								<th><?php echo __('Last Name',true);?></th>
								<th class="actions t-right"><?php echo $this->Html->link(__('Nowy pracownik', true), array('action' => 'add_emplo'),array('class'=>'add')); ?></th>
							</tr>
							<?php
							$i = 0;
							if(isset($emplo) && !empty($emplo)){
							foreach ($emplo as $user){
								$class = null;
								if ($i++ % 2 == 0) {
									$class = ' class="altrow"';
								}
							?>
							<tr<?php echo $class;?>>
								<td><?php echo $user['User']['id']; ?>&nbsp;</td>
								<td><?php echo $user['User']['email']; ?>&nbsp;</td>
								<td><?php echo $this->Html->link((($user['User']['status']) ? __('aktywny',true) : __('nie aktywny',true)),array('controller'=>'users','action' => 'status', $user['User']['id'])) ?>&nbsp;</td>					
								<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
								<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
								<td class="actions">
									<?php echo $this->Html->link('', array('controller'=>'users','action' => 'edit', $user['User']['id']),array('title'=>__('edytuj', true),'class'=>'edit')); ?>
									<?php echo $this->Html->link('', array('action' => 'delete', $user['User']['id']),array('title'=>__('usuń', true),'class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
								</td>
							</tr>
							<?php }} ?>
						</table>
					</div>
				<?php }?>
												
				<?php if($user_typ == 'manag'){?>
				<div id="tabs-providers">
					<h2><?php __('Moderatorzy');?></h2>
					<table cellpadding="0" cellspacing="0" class="index">
						<tr>
							<th><?php echo __('No',true);?></th>
							<th><?php echo __('Email',true);?></th>
							<th><?php echo __('Status',true);?></th>
							<th><?php echo __('First Name',true);?></th>
							<th><?php echo __('Last Name',true);?></th>
							<th class="actions t-right"><?php echo $this->Html->link(__('Nowy moderator', true), array('action' => 'add_manag'),array('class'=>'add')); ?></th>
						</tr>
						<?php
						$i = 0;
						if(isset($providers) && !empty($providers)){
						foreach ($providers as $user){
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>
						<tr<?php echo $class;?>>
							<td><?php echo $user['User']['id']; ?>&nbsp;</td>
							<td><?php echo $user['User']['email']; ?>&nbsp;</td>
							<td><?php echo $this->Html->link((($user['User']['status']) ? __('aktywny',true) : __('nie aktywny',true)),array('controller'=>'users','action' => 'status', $user['User']['id'])) ?>&nbsp;</td>
							<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
							<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
							<td class="actions">
								<?php echo $this->Html->link('', array('controller'=>'users','action' => 'edit', $user['User']['id']),array('title'=>__('edytuj', true),'class'=>'edit')); ?>
								<?php echo $this->Html->link('', array('action' => 'delete', $user['User']['id']),array('title'=>__('usuń', true),'class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
							</td>
						</tr>
						<?php }} ?>
					</table>
		
				</div>
				<?php }?>

				<?php if($user_typ == 'admin'){?>
				<div id="tabs-providers">
					<h2><?php __('Administratorzy');?></h2>
					<table cellpadding="0" cellspacing="0" class="index">
						<tr>
							<th><?php echo __('No',true);?></th>
							<th><?php echo __('Email',true);?></th>
							<th><?php echo __('Status',true);?></th>
							<th><?php echo __('Imię',true);?></th>
							<th><?php echo __('Nazwisko',true);?></th>
							<th class="actions t-right"><?php echo $this->Html->link(__('Nowy administrator', true), array('action' => 'add_admin'),array('class'=>'add')); ?></th>
						</tr>
						<?php
						$i = 0;
						
						if(isset($admin) && !empty($admin)){
						foreach ($admin as $user){
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>
						<tr<?php echo $class;?>>
							<td><?php echo $user['User']['id']; ?>&nbsp;</td>
							<td><?php echo $user['User']['email']; ?>&nbsp;</td>
							<td><?php echo $this->Html->link((($user['User']['status']) ? __('aktywny',true) : __('nie aktywny',true)),array('controller'=>'users','action' => 'status', $user['User']['id'])) ?>&nbsp;</td>
							<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
							<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
							<td class="actions">
								<?php echo $this->Html->link('', array('controller'=>'users','action' => 'edit', $user['User']['id']),array('title'=>__('edytuj', true),'class'=>'edit')); ?>
								<?php echo $this->Html->link('', array('action' => 'delete', $user['User']['id']),array('title'=>__('usuń', true),'class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
							</td>
						</tr>
						<?php }} ?>
					</table>
		
				</div>
				<?php }?>				
		<div class="clear">&nbsp;</div>
	</div>
	<div class="clear">&nbsp;</div>
	
				
</div>
 <div class="clr"></div>